Skip to content

Fix: keyword stuffing detection prose-density gate#73

Merged
dacharyc merged 1 commit intomainfrom
fix/keyword-stuffing-detection
Apr 19, 2026
Merged

Fix: keyword stuffing detection prose-density gate#73
dacharyc merged 1 commit intomainfrom
fix/keyword-stuffing-detection

Conversation

@dacharyc
Copy link
Copy Markdown
Member

@dacharyc dacharyc commented Apr 19, 2026

What this PR does

Issue #71 highlighted a case where the keyword-stuffing heuristic incorrectly flagged prose as keyword stuffing. This PR adds a minimum average words per segment check, which assumes that keyword stuffing will be 1-2 words per segment, while genuine prose will have a higher words-per-segment density.

This may still be problematic, but hopefully we're circling closer to something useful. At the very least, it solves the case reported in 71.

How to test

Adds a new test in structure/frontmatter_test.go for the exact description reported in 71. The new test plus all existing tests are green with this change.

Checklist

  • Tests pass locally (go test -race ./... -count=1)
  • Lint passes locally (golangci-lint run)
  • New functionality includes tests
  • Breaking changes are noted above (if any)

@dacharyc dacharyc merged commit 81727fe into main Apr 19, 2026
3 checks passed
@dacharyc dacharyc deleted the fix/keyword-stuffing-detection branch April 19, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant